//
//  HomeGoodsCell.swift
//  LeGou
//
//  Created by lxm on 2022/7/27.
//

import UIKit

class VIPMallGoodsCell: UICollectionViewCell {
    @IBOutlet weak var label: UILabel!
            
    @IBOutlet weak var img: UIImageView!

    @IBOutlet weak var activityNum: UIButton!
    
    @IBOutlet weak var interests: UIButton!
    
    @IBOutlet weak var saleCount: UILabel!
    
    @IBOutlet weak var rmb: UILabel!
    @IBOutlet weak var price: UILabel!
    
    let tan = DetailShareView.TriangleView()

    
    static var bootomH : CGFloat = 66.5
    
    let disposeBag = DisposeBag()
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        bindAction()
        
        tan.direction = .up
        tan.fillColor = UIColor.zm.color(hexString: "#F9D591", 0.65)
        addSubview(tan)
        tan.snp.makeConstraints { make in
            make.centerX.equalTo(activityNum)
            make.bottom.equalTo(activityNum.snp.top)
            make.width.equalTo(5)
            make.height.equalTo(3.5)
        }
        
        if AppHelper.appVerify() {
            interests.setTitle("乐购精选", for: .normal)
        }
    }
    
    func bindAction() {
        interests.rx.tap.subscribe(onNext:{ resp in
            CommonService.shared.goWeb(type: .serviceIntro)
        }).disposed(by: disposeBag)
    }

    override func layoutSubviews() {
        super.layoutSubviews()
        activityNum.style.GradientLeftToRight(Top: "#F8D490".zm.hex(), Bottom: "#FBE7AF".zm.hex())
    }
}
